package demo.service.impl;

import java.io.Serializable;
import java.util.List;

import demo.dao.impl.GenericDaoImpl;
import demo.service.GenericService;

public class GenericServiceImpl<T, ID extends Serializable, GeneralDao extends GenericDaoImpl<T, ID>> implements GenericService<T, ID> {

	protected GeneralDao generalDao;
	
	@Override
	public ID save(T t) {
		return generalDao.save(t);
	}
	
	public void setGeneralDao(GeneralDao generalDao) {
		this.generalDao = generalDao;
	}

	public GeneralDao getGeneralDao() {
		return generalDao;
	}

	@Override
	public List<T> queryAll() {
		return generalDao.queryAll();
	}

	@Override
	public List<T> queryByNameParam(String queryString, String[] paramNames, Object[] values) {
		return generalDao.queryByNameParam(queryString, paramNames, values);
	}

	@Override
	public T queryById(ID id) {
		return generalDao.queryById(id);
	}

	@Override
	public void delete(ID id) {
		generalDao.delete(id);
	}
	
	@Override
	public void delete(T t) {
		generalDao.delete(t);
	}

	@Override
	public void update(T t) {
		generalDao.update(t);
	}

	@Override
	public List<T> queryByHql(String queryString) {
		return generalDao.queryByHql(queryString);
	}

}
